<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <!-- <script src="./ajax (1).js"></script>
    <script>
        let json = null
        ajax('./a.json').then(r => json = r)
        console.log(json);//null
    </script>
    <script type="module">
        let json = null
        try {
            json = await ajax('./a1.json')
        } catch (e) {
            console.log(e);
        }
        console.log(json);//1
    </script> -->

    <!-- <script>
        async function fn(n) {
            console.log(n);
            await 1  //以后的代码变为异步
            console.log(n + 1);

            /* await之后的代码变为
            Promise.resolve(1).then(()=>{
                console.log(n+1)
            }
            )
            */
        }
        console.log(1);
        fn(100)
        console.log(2);
    </script> -->


    <button onclick="console.log('click')">btn</button>

    <script>
        for (let i = 0; i < 8 * 10 ** 9; i++) {

        }
        console.log('循环结束');
    </script>
</body>

</html>